<?php

class Application_Form_SimCMSUser extends Zend_Form
{

    public function init()
    {
        // set form method to POST
        $this->setMethod('post');
 
        // firstname input field
        $this->addElement('text', 'firstname', array(
            'label'      => 'Vorname:',
            'required'   => true,
            'filters'    => array('StringTrim'),
        ));
        
        // name input field
        $this->addElement('text', 'name', array(
            'label'      => 'Nachname:',
            'required'   => true,
            'filters'    => array('StringTrim'),
        ));
        
        // nickname input field
        $this->addElement('text', 'nickname', array(
            'label'      => 'Benutzername:',
            'required'   => true,
            'filters'    => array('StringTrim'),
        ));
        
        // e-mail input field
        $this->addElement('text', 'email', array(
            'label'      => 'Deine Email Adresse:',
            'required'   => true,
            'filters'    => array('StringTrim'),
            'validators' => array(
                'EmailAddress',
            )
        ));
 
        // Das Kommentar Element hinzufügen
        $this->addElement('password', 'password', array(
            'label'      => 'Passwort:',
            'required'   => true,
        ));
 
        // Ein Captcha hinzufügen
        $this->addElement('captcha', 'captcha', array(
            'label'      => "Bitte die 5 Buchstaben eingeben die unterhalb "
                          . "angezeigt werden:",
            'required'   => true,
            'captcha'    => array(
                'captcha' => 'Figlet',
                'wordLen' => 5,
                'timeout' => 300
            )
        ));
 
        // Ein Captcha hinzufügen
        $this->addElement('hidden', 'rank', array(
            'value'      => 1
            )
        );

 
        
        // Den Submit Button hinzufügen
        $this->addElement('submit', 'submit', array(
            'ignore'   => true,
            'label'    => 'Benutzer hinzufügen',
        ));
 
        // Und letztendlich etwas CSRF Protektion hinzufügen
        $this->addElement('hash', 'csrf', array(
            'ignore' => true,
        ));
    }


}

